import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { RowType } from '@/type/station'
export const useStationStore = defineStore('station', () => {
    const rowData = ref<RowType>({
        name: "",
        id: "",
        city: "",
        fast: "",
        slow: "",
        status: 1,
        now: "",
        fault: "",
        person: "",
        tel: ""
    })
    const setData = (row: RowType) => {
        rowData.value = row
    }
    const resetStation = () => {
        rowData.value = {
            name: "",
            id: "",
            city: "",
            fast: "",
            slow: "",
            status: 1,
            now: "",
            fault: "",
            person: "",
            tel: ""
        }
    }
    return { rowData,setData,resetStation}
})